class CreateForums < ActiveRecord::Migration
  def self.up
    create_table :forums do |t|
      t.column :category_id, :integer, :null => false
      t.column :position, :integer, :null => false
      t.column :name, :string
      t.column :description, :text
      t.column :description_html, :text
      t.column :topics_count, :integer, :default => 0
      t.column :posts_count, :integer, :default => 0
      t.column :last_reply_id, :integer
      t.column :permalink, :string
      t.column :last_reply_in, :integer
    end
    
    add_index :forums, :category_id
  end

  def self.down
    drop_table :forums
  end
end
